//
//  FlashCaleModel.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2023/10/25.
//

import UIKit
import ObjectMapper

class FlashCaleModel:  Mappable {
    var code: String?
    var msg: String?
    var data: PromotionModel?
    func mapping(map: Map) {
        code <- map["code"]
        msg <- map["msg"]
        data <- map["data"]
    }
    required init?(map: Map) {
    }
    
}

class PromotionModel:  Mappable {
    var promotion: PromotionCotentModel?
    func mapping(map: Map) {
        promotion <- map["promotion"]
   
    }
    required init?(map: Map) {
    }
}




class PromotionCotentModel: Mappable {
    var promotionId: NSInteger?
    var id: Int?
    var createdTime: String?
    var modifyTime: String?
    var version: Int?
    var delFlag: Int?
    var status: Int?
    var activityTime: NSInteger?
    var name: String?//活动名
    var start: String?//开始时间
    var end: String?//结束时间
    var picPc: String?//pc图片
    var picApp: String?//app图片
    var products: [ProductsDataModel]?
    func mapping(map: Map) {
        promotionId <- map["promotionId"]
        id <- map["id"]
        createdTime <- map["createdTime"]
        modifyTime <- map["modifyTime"]
        version <- map["version"]
        delFlag <- map["delFlag"]
        status <- map["status"]
        name <- map["name"]
        start <- map["start"]
        end <- map["end"]
        picPc <- map["picPc"]
        picApp <- map["picApp"]
        activityTime <- map["activityTime"]
        products <- map["products"]
     
    }
    required init?(map: Map) {}
}


class ProductsDataModel:  Mappable {
    var id: NSInteger?
    var modifyTime: String?
    var createdTime: String?
    var name: String?
    var categoryId: NSInteger?
    var categoryName: String?
    var productNo: String?
    var productImages: String?
    var productDecr: String?
    var isShelf: Bool?
    var isLimitedTime: Bool?
    var isTop: Bool?
    var price: Double?
    var discountPrice: Double?
    var originalPrice: Double?
    var promotionPrice: Double?
    var stock: NSInteger?
    var stockLock: Double?
    var skuId: NSInteger?
    var isDiscount: NSInteger?
    var availableStock: NSInteger?
    var isValid: Bool?
    var productImage: String?
    var isSellOut: Bool?
    
    func mapping(map: Map) {
        id <- map["id"]
        createdTime <- map["createdTime"]
        modifyTime <- map["modifyTime"]
        categoryId <- map["categoryId"]
        categoryName <- map["categoryName"]
        productNo <- map["productNo"]
        name <- map["name"]
        productImages <- map["productImages"]
        productDecr <- map["productDecr"]
        isShelf <- map["isShelf"]
        isLimitedTime <- map["isLimitedTime"]
        isTop <- map["isTop"]
        price <- map["price"]
        discountPrice <- map["discountPrice"]
        
        originalPrice <- map["originalPrice"]
        promotionPrice <- map["promotionPrice"]
        stock <- map["stock"]
        stockLock <- map["stockLock"]
        skuId <- map["skuId"]
        isDiscount <- map["isDiscount"]
        availableStock <- map["availableStock"]
        isValid <- map["isValid"]
        productImage <- map["productImage"]
        isSellOut <- map["isSellOut"]
   
    }
    required init?(map: Map) {
    }
    
}
